<template>
	<div class="modify-dialog">
		<slot> </slot>
		<el-dialog :close-on-click-modal="false" v-bind="dialogOpts" :visible.sync="dialogVisible">
			<div class="form-wrap">
				<Form v-bind="formOpts" v-on="formEvent">
					<template #formBtn>
						<div></div>
					</template>
				</Form>
			</div>
			<template #footer>
				<div class="dialog-footer">
					<el-button @click="dialogVisible = false">取 消</el-button>
					<el-button type="primary" @click="onConfirm"> 确 定 </el-button>
				</div>
			</template>
		</el-dialog>
	</div>
</template>

<script>
import modifyMixins from "@/mixins/modifyMixins.vue";

export default {
	mixins: [modifyMixins],
	data() {
		return {
			dialogTitle: "付款完成",
			labelPosition: "left",
			form: {
				payAmount: {
					tag: "el-input",
					label: "已支付总金额",
					value: "",
					props: {
						type: "number",
						min: 0,
						placeholder: "请输入已支付总金额",
					},
				},
				payVoucher: {
					tag: "Uploader",
					label: "付款凭证",
					value: [],
					props: {},
				},
			},
		};
	},
	computed: {},
	methods: {
		onSubmit(form) {
			const { id } = this.row;
			form.status = "1";
			form.id = id;
			if (!form.payAmount) return this.$message.error("请完善已支付总金额");
			if (!form.payVoucher.length) return this.$message.error("请完善付款凭证");
			this.$api["newFinanceUpdate"](form).then(this.submitDoneMsg);
		},
	},
};
</script>

<style lang="less" scoped>
.modify-dialog {
	:deep(.el-form-item__content) {
		width: 220px !important;
	}
}
</style>

